<?php

 	$product = $this->product;

	echo "<h1>{$product->name}</h1>";
	
?>
<div id='leftCol'>
<?php

	if ($product->productimages) {
		echo '<div id="vpl">';
		echo link_to(image_tag("vpl/{$product->productimages[0]->name}"), array('action' => 'showImages', "id" => $product->id, 'anchor' => $product->productimages[0]->name), array("target" => "_blank", 'id' => 'vplImageLink'));
		echo '</div>';
		echo "<br />";

		echo '<div id="vpses">';
		foreach ($product->productimages as $img) {
			link_to(image_tag("vps/{$img->name}"), array('action' => 'showImages', "id" => $product->id, 'anchor' => $img->name), array('target' => '_blank'));
		}
		echo '</div>';
	}

		echo "Price {$product->price}";
		echo link_to('Add to Cart', array('action' => 'addToCart', 'id' => $product->id));

	echo "<br />This product is a ";

	$typeOfProduct = array();
	foreach ($product->playgroundequipments as $playgroundequipment) {
		$typeOfProduct[] = link_to(ucfirst("{$playgroundequipment->name}"), array('action' => 'productList', 'type' => $playgroundequipment->name));
	}
	echo implode(', ', $typeOfProduct);

?>
</div>

<div id='rightCol'>
<dl>
	<dt><?php echo link_to('Description', '#'); ?></dt>
	<dd><?php echo $product->description; ?></dd>
	<dt><?php echo link_to('Specification', '#'); ?></dt>
	<dd id='specks'>
	<?php 
		echo '<br />Description<br />';
		echo $product->description;

	
		echo '<br />Specification<br />';
		echo $product->specification;

		echo '<br />Product #<br />';
		echo $product->id;


		echo '<br /><br />Manufacture Time<br />';
		echo $product->manufacture_time;

		echo '<br /><br />Length<br />';
		echo $product->length;

		echo '<br /><br />Width<br />';
		echo $product->width;

		echo '<br /><br />Height<br />';
		echo $product->height;

		echo '<br /><br />Warentee<br />';
		echo $product->warentee;

		echo '<br /><br />Labout<br />';
		echo $product->labour;

		echo '<br /><br />Parts<br />';
		echo $product->parts;
	?>
	</dd>
	<dt><?php echo link_to("Comments ({$product->comments_count})", '#'); ?></dt>
	<dd>
		<?php
			if ($product->comments) {
				foreach ($product->comments as $comment) {
					echo "<br /> {$comment->comment} - {$comment->product->name} ";
				}
			}
			else {
				echo "No comments found. Would you like to be the first to make a comment on this product?";
			}

			echo "<br /><br /><br /><br />";

			start_form_tag('addComment/' . ID);

				label('comment', 'comment');
				text_field("comment", "comment");

			echo "<br />";
			submit_tag('Submit Comment', array('disabled' => 'Comment submitted'));
			end_form_tag();
		?>
	</dd>
</dl>
</div>